package smetana.modules.ui.actions;

import com.google.inject.Inject;
import smetana.domain.join.DocReport;
import smetana.domain.raw.Doc;
import smetana.modules.business.BusinessDoc;
import smetana.modules.ui.model.CursorDoc;
import smetana.modules.ui.model.UIModel;
import smetana.util.Pivot;

/**
 *
 * @author dmitry.mamonov
 */
public class CreateDocumentAction extends AbstractEditDocumentAction{
    @Inject
    BusinessDoc businessDoc;

    @Inject
    UIModel uiModel;

    @Inject
    CursorDoc cursorDoc;

    @Override
    public void perform() {
        Doc document = businessDoc.newDoc();
        DocReport docReport = businessDoc.findDocReportById(document.getId());

        handleActionsAndToolbar();
        cursorDoc.refreshFor(docReport);
        handleLoadAndSwitch();
    }
}
